package com.filldream.fastboot.base.response.pc.database;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * 列的数据信息
 * @author dengjie
 * @date 2019-01-02
 */
@Data
@NoArgsConstructor
public class ColumnInfo implements Serializable {

    @ApiModelProperty(value = "表名称")
    private String tableName;

    @ApiModelProperty(value = "数据库字段名称")
    private String columnName;

    @ApiModelProperty(value = "数据库字段是否允许为空 NO-不允许为空 YES-允许为空")
    private String isNullable;

    @ApiModelProperty(value = "数据库字段类型")
    private String dataType;

    @ApiModelProperty(value = "数据库字段备注")
    private String columnComment;

    @ApiModelProperty(value = "索引类型")
    private String columnKey;

    @ApiModelProperty(value = "字段额外的参数 auto_increment-自增 on update CURRENT_TIMESTAMP-更新时间")
    private String extra;

    @ApiModelProperty(value = "默认值")
    private String columnDefault;

    private String columnType;

    @ApiModelProperty(value = "数据库字段是否允许为空 0-不允许为空 1-允许为空  true-允许为空 false-不允许为空")
    public boolean getCanNull(){
        return isNullable.equals("YES");
    }

}
